// ==UserScript==
// @ScriptName        优化手机网页端显示
// @Author            @elecV2, modified by Cuttlefish
// @Github            https://github.com/elecV2
// @TgChannel         https://t.me/elecV2, https://t.me/ddgksf2021
// @WechatID          墨鱼手记
// @UpdateTime        20210328
// @ScriptURL         https://raw.githubusercontent.com/ddgksf2013/Cuttlefish/master/Rewrite/Function/Betterweb.conf
// ==/UserScript==

hostname = blog.csdn.net, *.openinstall.io, www.google.com, pan.baidu.com, oia.zhihu.com, link.zhihu.com, www.zhihu.com, post.smzdm.com, post.m.smzdm.com, 



# > 05 什么值得买
;post.m.smzdm.com 重定向及更改到桌面版 User-Agent
^https:\/\/post\.m\.smzdm\.com url 307 https://post.smzdm.com
^https:\/\/post\.smzdm\.com\/ url request-header (\r\n)User-Agent:.+(\r\n) request-header $1User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.83 Safari/537.36$2
;再注入 CSS 进行优化
^https:\/\/post\.smzdm\.com\/ url script-response-body https://raw.githubusercontent.com/elecV2/QuantumultX-Tools/master/betterweb/smzdm.res.js


# > 04 知乎
;先重写到桌面版
^https:\/\/www\.zhihu\.com\/(question|topic) url request-header (\r\n)User-Agent:.+(\r\n) request-header $1User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.83 Safari/537.36$2
;再注入 CSS 进行优化
^https:\/\/www\.zhihu\.com\/question url script-response-body https://raw.githubusercontent.com/elecV2/QuantumultX-Tools/master/betterweb/zhihux.user.js
^https:\/\/www\.zhihu\.com\/topic url script-response-body https://raw.githubusercontent.com/elecV2/QuantumultX-Tools/master/betterweb/zhihux.user.js
;去掉知乎跳转第三方网站的中间页面
^https?:\/\/link\.zhihu\.com/\?target=(https?)%3A//(.*) url 307 $1://$2
;不跳转应用商店
^https:\/\/oia\.zhihu\.com\/answers\/([0-9]+)\?.* url 307 https://www.zhihu.com/answer/$1
^https:\/\/oia\.zhihu\.com\/articles\/([0-9]+)\?.* url 307 https://zhuanlan.zhihu.com/p/$1

# > 03 百度云
;先重写到桌面版
^https:\/\/pan\.baidu\.com url request-header (\r\n)User-Agent:.+(\r\n) request-header $1User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36$2
;再注入 CSS 进行优化
^https:\/\/pan\.baidu\.com url script-response-body https://raw.githubusercontent.com/elecV2/QuantumultX-Tools/master/betterweb/baiduPan.js

# > 02 google
;去除 url 中的其他参数
https:\/\/www\.google\.com\/(m|search).+(q=[^&]+) url script-request-header https://raw.githubusercontent.com/elecV2/QuantumultX-Tools/master/google/simplifyurl.js
;自动翻页
# > 暂时屏蔽
;https:\/\/www\.google\.com\/(m|search) url script-response-body https://raw.githubusercontent.com/elecV2/QuantumultX-Tools/master/google/Endless_Google.user.js
;只保留搜索关键字。(不能翻页、转到图片/视频等其他搜索)
;https:\/\/www\.google\.com\/(m|search).+(q=[^&]+)&.+ url 307 $1?$2
;google.cn 重定向
^https?:\/\/(www.)?(g|google)\.cn url 302 https://www.google.com

# > 01 CSDN
;先重写到桌面版
^https:\/\/blog\.csdn\.net\/ url request-header (\r\n)User-Agent:.+(\r\n) request-header $1User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.83 Safari/537.36$2
;再注入 CSS 进行优化
^https:\/\/blog\.csdn\.net\/ url script-response-body https://raw.githubusercontent.com/elecV2/QuantumultX-Tools/master/betterweb/csdn.res.js
;免跳转应用商店(也可以直接 filter 屏蔽 openinstall.io) *重写到桌面版后，这条规则基本就没什么用了*
^https:\/\/wvhzpj\.openinstall\.io\/ulink url script-echo-response https://raw.githubusercontent.com/elecV2/QuantumultX-Tools/master/betterweb/csdn.req.js
